package com.hk.player.utils;

import com.hk.player.core.IHkPlayerProvider;
import com.zhoug.router.Router;

/**
 * @author: zhoug
 * @since: 2025-08-06
 */
public class PlayerProviderManager {

    public static <T> T getProvider(Class<? extends T> clz) {
        T provider = Router.getProvider(clz);
        if (provider == null) {
            throw new IllegalStateException("服务未注册:" + clz.getCanonicalName());
        }
        return provider;
    }

    public static IHkPlayerProvider getHkPlayerProvider() {
        return getProvider(IHkPlayerProvider.class);
    }

}
